Move some definitions from xg_save_resotre.h to xg_private.h
authorKeir Fraser <keir@xensource.com>
Sat, 24 Feb 2007 14:19:42 +0000 (14:19 +0000)
committerKeir Fraser <keir@xensource.com>
Sat, 24 Feb 2007 14:19:42 +0000 (14:19 +0000)
which are necessary for the new dump core implementation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
tools/libxc/xc_linux_restore.c
tools/libxc/xc_linux_save.c
tools/libxc/xg_private.h
tools/libxc/xg_save_restore.h

index 822f3c5ec2f73dc6cb0cc1725630956297832bcc..9627d96031520c26331d3e90873791f0fdcf6b90 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "xg_private.h"
 #include "xg_save_restore.h"
+#include "xc_dom.h"
 
 /* max mfn of the current host machine */
 static unsigned long max_mfn;
index 35a5a5cd55124ca5399d0d8e3aaa9522e5c346a3..6b51872ac5d45af95b833a804110d4a0b9283778 100644 (file)
@@ -13,6 +13,7 @@
 #include <sys/time.h>
 
 #include "xc_private.h"
+#include "xc_dom.h"
 #include "xg_private.h"
 #include "xg_save_restore.h"
 
index 3cf6fbf22ad04cd3ade12aa2b15978f3209fb24e..2b66a29763a36e0b3000f29575ea580d3ec198d2 100644 (file)
@@ -146,6 +146,23 @@ typedef l4_pgentry_64_t l4_pgentry_t;
 #define PAGE_SIZE_IA64          (1UL << PAGE_SHIFT_IA64)
 #define PAGE_MASK_IA64          (~(PAGE_SIZE_IA64-1))
 
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+/* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */
+#define P2M_SIZE        ROUNDUP((max_pfn * sizeof(xen_pfn_t)), PAGE_SHIFT)
+
+/* Number of xen_pfn_t in a page */
+#define fpp             (PAGE_SIZE/sizeof(xen_pfn_t))
+
+/* Number of entries in the pfn_to_mfn_frame_list_list */
+#define P2M_FLL_ENTRIES (((max_pfn)+(fpp*fpp)-1)/(fpp*fpp))
+
+/* Number of entries in the pfn_to_mfn_frame_list */
+#define P2M_FL_ENTRIES  (((max_pfn)+fpp-1)/fpp)
+
+/* Size in bytes of the pfn_to_mfn_frame_list     */
+#define P2M_FL_SIZE     ((P2M_FL_ENTRIES)*sizeof(unsigned long))
+
 #define PAEKERN_no           0
 #define PAEKERN_yes          1
 #define PAEKERN_extended_cr3 2
index 5496f02b70a93976710dac928e85c410f98d049e..8579ca8a5e26290a12cd6f071641e90e5789f504 100644 (file)
@@ -81,7 +81,6 @@ static inline int get_platform_info(int xc_handle, uint32_t dom,
 */
 
 #define PFN_TO_KB(_pfn) ((_pfn) << (PAGE_SHIFT - 10))
-#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
 
 /*
@@ -94,25 +93,5 @@ static inline int get_platform_info(int xc_handle, uint32_t dom,
 #define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT)
 #define M2P_CHUNKS(_m)  (M2P_SIZE((_m)) >> M2P_SHIFT)
 
-/* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */
-#define P2M_SIZE        ROUNDUP((max_pfn * sizeof(xen_pfn_t)), PAGE_SHIFT)
-
-/* Number of xen_pfn_t in a page */
-#define fpp             (PAGE_SIZE/sizeof(xen_pfn_t))
-
-/* Number of entries in the pfn_to_mfn_frame_list */
-#define P2M_FL_ENTRIES  (((max_pfn)+fpp-1)/fpp)
-
-/* Size in bytes of the pfn_to_mfn_frame_list     */
-#define P2M_FL_SIZE     ((P2M_FL_ENTRIES)*sizeof(unsigned long))
-
-/* Number of entries in the pfn_to_mfn_frame_list_list */
-#define P2M_FLL_ENTRIES (((max_pfn)+(fpp*fpp)-1)/(fpp*fpp))
-
 /* Returns TRUE if the PFN is currently mapped */
 #define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
-
-#define INVALID_P2M_ENTRY   (~0UL)
-
-
-